

package cn.shengchao.examstart.user.ohs.local.messages;

import cn.hutool.core.util.DesensitizedUtil;
import cn.shengchao.examstart.user.domain.entity.UserRealPerson;
import lombok.Data;
import org.springframework.web.multipart.MultipartFile;

import java.time.LocalDateTime;

@Data
public class UserRealPersonDto {
    private String realName;
    private String idcard;
    private String idcardFront;
    private String idcardBack;
    private LocalDateTime time;
    private MultipartFile realPersonVideo;

    public static UserRealPersonDto of(UserRealPerson userRealPerson) {
        UserRealPersonDto userRealPersonDto = new UserRealPersonDto();
        userRealPersonDto.setRealName(DesensitizedUtil.chineseName(userRealPerson.getRealName()));
        userRealPersonDto.setIdcard(DesensitizedUtil.idCardNum(userRealPerson.getIdcard(), 3, 4));
        userRealPersonDto.setTime(userRealPerson.getTime());
        return userRealPersonDto;
    }
}
